using UnityEngine;
using System.Collections;

public class Pauser : MonoBehaviour {
	
	protected bool paused;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		//use "space" key to pause the game
		if (Input.GetButtonUp("pause")) 
		{
			if (!paused) 
			{
				Time.timeScale = 0;
				paused = true;
			}
			else
			{
				Time.timeScale = 1;
				paused = false;
			}
		}
	}
}
